/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2019
 */

package com.jzwl.site.wap.articlestudy.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jzwl.site.wap.articlestudy.dao.SiteArticleUserStudyDao;

@Service("siteArticleUserStudyService")
public class SiteArticleUserStudyService {

	@Autowired
	private SiteArticleUserStudyDao siteArticleUserStudyDao;

	public boolean addSiteArticleUserStudy(Map<String, Object> map) {
		//如果该人员已经阅读，则不进行数据存储
		List list = siteArticleUserStudyDao.querySiteArticleUserStudy(map);
		if (list.size() == 0) {
			return siteArticleUserStudyDao.addSiteArticleUserStudy(map);
		}
		return true;

	}

	/**
	 * 根据文章的Id获取文章学习人员的列表
	 * @param map
	 */
	public List querySiteArticleUserStudyList(Map<String, Object> map) {

		return siteArticleUserStudyDao.querySiteArticleUserStudyList(map);

	}

}
